
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
help-version
Advanced tools
Automatic handling of --help
and --version
arguments for CLI applications.
#!/usr/bin/env node
var helpVersion = require('help-version')(usage());
function usage() {
return 'Usage: my-app [file]';
}
helpVersion.version()
//=> "v0.1.0"
console.log('main thing');
Catches --help
and --version
automatically.
$ ./app.js --help
Usage: my-app [file]
$ ./app.js --version
v0.1.0
$ ./app.js
main thing
helpVersion = require('help-version')(help, [version])
Checks process.argv
for --help
or --version
, prints help
or version
if found one.
version
defaults to version
field from your local package.json
.
helpVersion.help([code], [stream])
With no arguments, returns the help
string.
With one or two arguments, writes help
to the stream
and exits with code
. stream
defaults to process.stdout
if code==0
and process.stderr
otherwise.
helpVersion.version([code], [stream])
Returns version
string or writes it to stream
and exits.
npm install help-version
MIT
FAQs
Handle --help and --version arguments in your CLI application
The npm package help-version receives a total of 12 weekly downloads. As such, help-version popularity was classified as not popular.
We found that help-version demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.